﻿// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using Newtonsoft.Json.Linq;

namespace NuGetGallery.Helpers
{
    public static class VulnerabilityItemsHelper
    {
        public static IEnumerable<object[]> ValidObjects
        {
            get
            {
                yield return new object[] {
                        new JArray() {
                            JObject.FromObject(new
                            {
                                AdvisoryURL = "url",
                                Severity = 1
                            })
                        }
                    };
                yield return new object[] {
                        new JArray() {
                            JObject.FromObject(new
                            {
                                AdvisoryURL = "url",
                                Severity = 1
                            }),
                            JObject.FromObject(new
                            {
                                AdvisoryURL = "url",
                                Severity = 2
                            })
                        }
                    };
            }
        }

        public static IEnumerable<object[]> InvalidObjects
        {
            get
            {
                yield return new object[] { new JArray() };
                yield return new object[] { null };
            }
        }
    }
}
